var index_divclose;
window.onload=function(){
	if(!zeai.empty(o('showtype_box'))){
		var scsA = scs.split('&'),newA=[],s;
		for(var k=0;k<scsA.length;k++) {
			s=scsA[k].split('=');
			if(!zeai.empty(s[1])){
				newA.push(s[0]+'='+s[1]);
			}
		}
		zeai.listEach(zeai.tag(o('showtype_box'),'a'),function(obj,i){obj.onclick=function(){showtypeFn(newA,i);}});
	}
	processHash_izt();
}
function showtypeFn(newA,i){
	var A=[];
	for(var k=0;k<newA.length;k++) {
		ss=newA[k].split('=');
		if(ss[0]=='showtype'){
			A.push(ss[0]+'='+(i+1));
		}else{
			A.push(newA[k]);
		}
	}
	var A=A.join("&");
	zeai.openurl('izt'+zeai.ajxext+A);
}
function processHash_izt () {
	var hashStr = location.hash.replace("#","");
	if (hashStr){
		o("p").value = hashStr;
	}else{
		loadswitch_izt=true;
	}
}
if(mobkind()=='ios'){
	window.addEventListener('pagehide', function () {sessionStorage.ttback=sessionStorage.tt;});
}else{
	window.onbeforeunload=function(e){sessionStorage.ttback=sessionStorage.tt;}
}
if(pagemore){
	document.write('<input type="hidden" id="p" value="1" />');
	var loadswitch_izt=true;
	window.onhashchange = processHash_izt;
	document.body.onscroll = function(){
		var tt = zeai.getScrollTop(),cH= parseInt(document.documentElement.clientHeight),sH= parseInt(document.body.scrollHeight);//cH=document.documentElement.clientHeight;
		if(tt>0)sessionStorage.tt=tt;
		if ((sH-tt-cH) <100 && loadswitch_izt){
			var i = parseInt(o("p").value);
			if(i==4 && !iflogin){
				setTimeout(function(){index_divclose=ZeaiM.div({obj:index_bounce_box,w:30,h:30});},100);
				loadswitch_izt=false;
				return false
			}
			i++;o("p").value = i;
			location.hash = "#" + i;
			if (i > ZEAI_totalP){
				location.hash = "#" + ZEAI_totalP;
				o("p").value  = ZEAI_totalP;
				return false;
			}else{
				loadswitch_izt=false;
				Object.assign(zeaiOnscroll_json.data,{p:i});
				zeai.ajax(zeaiOnscroll_json,function(e){
					if (e == 'end'){
						return false;
					}else{
						ZEAI_list.append(e);
						loadswitch_izt=true;
					}
				});
			}
		}
		backtopFn();
	}
	window.addEventListener('pageshow', function (event) {
		if(event.persisted || window.performance && window.performance.navigation.type == 2){
			var hashStr = location.hash.replace("#","");
			o('p').value = hashStr;
			getdata(2,hashStr);
			loadswitch_izt=true;
		}
	},false);
}
function getdata(bp,hashStr){
	if(bp>hashStr)return false;
	Object.assign(zeaiOnscroll_json.data,{p:bp});
	zeai.ajax(zeaiOnscroll_json,function(e){
		if (e == 'end'){
			return false;
		}else{
			ZEAI_list.append(e);
			if(bp==hashStr){zeai.setScrollTop(sessionStorage.ttback);}//alert('back：'+sessionStorage.ttback);
			bp++;
			if(bp<=hashStr)getdata(bp,hashStr);
		}
	});
}